<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>pciepsu: xpciepsu.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">pciepsu
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xpciepsu_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xpciepsu.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains the software API definition of the Xilinx PSU PCI IP (psu_pcie). </p>
<p>This driver provides "C" function interface to application/upper layer to access the hardware.</p>
<p><b>Features</b> The driver provides its user with entry points</p>
<ul>
<li>To initialize and configure itself and the hardware</li>
<li>To access PCIe configuration space locally</li>
</ul>
<p><b>Driver Initialization &amp; Configuration</b></p>
<p>The XPciePsu_Config structure is used by the driver to configure itself. This configuration structure is typically created by the tool-chain based on HW build properties.</p>
<p>To support multiple runtime loading and initialization strategies employed by various operating systems, the driver instance can be initialized in the following way:</p>
<ul>
<li>XPciePsu_LookupConfig(DeviceId) - Use the device identifier to find the static configuration structure defined in xpciepsu_g.c. This is setup by the tools.</li>
<li>XPciePsu_CfgInitialize(InstancePtr, CfgPtr, EffectiveAddress) - Uses a configuration structure provided by the caller. If running in a system with address translation, the provided virtual memory base address replaces the physical address present in the configuration structure.</li>
</ul>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
</p>
<hr/>
<p>
1.0     bs      08/21/2018      First release
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a11bdbeb0f844db1d203f2b8f6f29ca5c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#a11bdbeb0f844db1d203f2b8f6f29ca5c">MAX_BARS</a>&#160;&#160;&#160;6</td></tr>
<tr class="memdesc:a11bdbeb0f844db1d203f2b8f6f29ca5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">No BAR allocation for Bridge.  <a href="#a11bdbeb0f844db1d203f2b8f6f29ca5c">More...</a><br/></td></tr>
<tr class="separator:a11bdbeb0f844db1d203f2b8f6f29ca5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acad74e57979d6bc62e24ddaa31ed11e9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#acad74e57979d6bc62e24ddaa31ed11e9">REQ_SIZE</a>&#160;&#160;&#160;(<a class="el" href="xpciepsu_8h.html#a11bdbeb0f844db1d203f2b8f6f29ca5c">MAX_BARS</a> * sizeof(unsigned long))</td></tr>
<tr class="memdesc:acad74e57979d6bc62e24ddaa31ed11e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Required size for BAR Alignment.  <a href="#acad74e57979d6bc62e24ddaa31ed11e9">More...</a><br/></td></tr>
<tr class="separator:acad74e57979d6bc62e24ddaa31ed11e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:acd35420aa1975d4b277d533e71be6187"><td class="memItemLeft" align="right" valign="top">XPciePsu_Config *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#acd35420aa1975d4b277d533e71be6187">XPciePsu_LookupConfig</a> (u16 DeviceId)</td></tr>
<tr class="memdesc:acd35420aa1975d4b277d533e71be6187"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function looks for the configuration of PCIe from the configTable based on the unique device ID.  <a href="#acd35420aa1975d4b277d533e71be6187">More...</a><br/></td></tr>
<tr class="separator:acd35420aa1975d4b277d533e71be6187"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d54a4fe188343ce59d689901c2b88c6"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#a3d54a4fe188343ce59d689901c2b88c6">XPciePsu_CfgInitialize</a> (XPciePsu *InstancePtr, const XPciePsu_Config *CfgPtr, UINTPTR EffectiveBrgAddress)</td></tr>
<tr class="memdesc:a3d54a4fe188343ce59d689901c2b88c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes the config space and PCIe bridge.  <a href="#a3d54a4fe188343ce59d689901c2b88c6">More...</a><br/></td></tr>
<tr class="separator:a3d54a4fe188343ce59d689901c2b88c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a862b72cd0796d429f122b5b83603f1d3"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#a862b72cd0796d429f122b5b83603f1d3">XPciePsu_EnumerateBus</a> (XPciePsu *InstancePtr)</td></tr>
<tr class="memdesc:a862b72cd0796d429f122b5b83603f1d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function starts PCIe enumeration.  <a href="#a862b72cd0796d429f122b5b83603f1d3">More...</a><br/></td></tr>
<tr class="separator:a862b72cd0796d429f122b5b83603f1d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c102ea980dacfdcfdfde291b60986be"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#a2c102ea980dacfdcfdfde291b60986be">XPciePsu_ReadConfigSpace</a> (XPciePsu *InstancePtr, u8 Bus, u8 Device, u8 Function, u16 Offset, u32 *DataPtr)</td></tr>
<tr class="memdesc:a2c102ea980dacfdcfdfde291b60986be"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function read from remote configuration space location.  <a href="#a2c102ea980dacfdcfdfde291b60986be">More...</a><br/></td></tr>
<tr class="separator:a2c102ea980dacfdcfdfde291b60986be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55212721869b9ddb1f187cdbefebdc57"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#a55212721869b9ddb1f187cdbefebdc57">XPciePsu_WriteConfigSpace</a> (XPciePsu *InstancePtr, u8 Bus, u8 Device, u8 Function, u16 Offset, u32 Data)</td></tr>
<tr class="memdesc:a55212721869b9ddb1f187cdbefebdc57"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function write to remote configuration space location.  <a href="#a55212721869b9ddb1f187cdbefebdc57">More...</a><br/></td></tr>
<tr class="separator:a55212721869b9ddb1f187cdbefebdc57"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad974ca02c5108cc4d4afbfa809474c75"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#ad974ca02c5108cc4d4afbfa809474c75">XPciePsu_ReadLocalConfigSpace</a> (XPciePsu *InstancePtr, u16 Offset, u32 *DataPtr)</td></tr>
<tr class="memdesc:ad974ca02c5108cc4d4afbfa809474c75"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read 32-bit value from one of this IP own configuration space.  <a href="#ad974ca02c5108cc4d4afbfa809474c75">More...</a><br/></td></tr>
<tr class="separator:ad974ca02c5108cc4d4afbfa809474c75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70154f924a73a1ee89b6b829bab05857"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#a70154f924a73a1ee89b6b829bab05857">XPciePsu_WriteLocalConfigSpace</a> (XPciePsu *InstancePtr, u16 Offset, u32 Data)</td></tr>
<tr class="memdesc:a70154f924a73a1ee89b6b829bab05857"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write 32-bit value to one of this IP own configuration space.  <a href="#a70154f924a73a1ee89b6b829bab05857">More...</a><br/></td></tr>
<tr class="separator:a70154f924a73a1ee89b6b829bab05857"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2d7bc13d9f1da8d6e67b88a1c37ed24"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#ac2d7bc13d9f1da8d6e67b88a1c37ed24">XPciePsu_ComposeExternalConfigAddress</a> (u8 Bus, u8 Device, u8 Function, u16 Offset)</td></tr>
<tr class="memdesc:ac2d7bc13d9f1da8d6e67b88a1c37ed24"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function Composes configuration space location.  <a href="#ac2d7bc13d9f1da8d6e67b88a1c37ed24">More...</a><br/></td></tr>
<tr class="separator:ac2d7bc13d9f1da8d6e67b88a1c37ed24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1cf81ffb26c43a972d2b92278b20cf7c"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#a1cf81ffb26c43a972d2b92278b20cf7c">XPciePsu_HasCapability</a> (XPciePsu *InstancePtr, u8 Bus, u8 Device, u8 Function, u8 CapId)</td></tr>
<tr class="memdesc:a1cf81ffb26c43a972d2b92278b20cf7c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns whether capability Id is available or not for the particular Function.  <a href="#a1cf81ffb26c43a972d2b92278b20cf7c">More...</a><br/></td></tr>
<tr class="separator:a1cf81ffb26c43a972d2b92278b20cf7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95b11e3f3a7fc1ae339795b380fde121"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#a95b11e3f3a7fc1ae339795b380fde121">XPciePsu_PrintAllCapabilites</a> (XPciePsu *InstancePtr, u8 Bus, u8 Device, u8 Function)</td></tr>
<tr class="memdesc:a95b11e3f3a7fc1ae339795b380fde121"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function prints all the available capabilities in the Function.  <a href="#a95b11e3f3a7fc1ae339795b380fde121">More...</a><br/></td></tr>
<tr class="separator:a95b11e3f3a7fc1ae339795b380fde121"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0cfd7833187346f6f654d80a359951b0"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#a0cfd7833187346f6f654d80a359951b0">XPciePsu_ReadReg</a> (UINTPTR BaseAddr, u32 RegOffset)</td></tr>
<tr class="memdesc:a0cfd7833187346f6f654d80a359951b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function reads a register value from specified offset.  <a href="#a0cfd7833187346f6f654d80a359951b0">More...</a><br/></td></tr>
<tr class="separator:a0cfd7833187346f6f654d80a359951b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a558622766b2c01af123a216c1d682376"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu_8h.html#a558622766b2c01af123a216c1d682376">XPciePsu_WriteReg</a> (UINTPTR BaseAddr, u32 RegOffset, u32 Val)</td></tr>
<tr class="memdesc:a558622766b2c01af123a216c1d682376"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function writes a register value to specified offset.  <a href="#a558622766b2c01af123a216c1d682376">More...</a><br/></td></tr>
<tr class="separator:a558622766b2c01af123a216c1d682376"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a11bdbeb0f844db1d203f2b8f6f29ca5c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MAX_BARS&#160;&#160;&#160;6</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>No BAR allocation for Bridge. </p>

</div>
</div>
<a class="anchor" id="acad74e57979d6bc62e24ddaa31ed11e9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REQ_SIZE&#160;&#160;&#160;(<a class="el" href="xpciepsu_8h.html#a11bdbeb0f844db1d203f2b8f6f29ca5c">MAX_BARS</a> * sizeof(unsigned long))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Required size for BAR Alignment. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a3d54a4fe188343ce59d689901c2b88c6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XPciePsu_CfgInitialize </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const XPciePsu_Config *&#160;</td>
          <td class="paramname"><em>CfgPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">UINTPTR&#160;</td>
          <td class="paramname"><em>EffectiveBrgAddress</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes the config space and PCIe bridge. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>pointer to XPciePsu Instance Pointer </td></tr>
    <tr><td class="paramname">CfgPtr</td><td>pointer to XPciePsu_Config instrance Pointer. </td></tr>
    <tr><td class="paramname">EffectiveBrgAddress</td><td>config brigReg address</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS on success err on failure </dd></dl>

<p>Referenced by <a class="el" href="xpciepsu__rc__enumerate__example_8c.html#aaa5f6815da393a21fa6e8d151c3569d0">PcieInitRootComplex()</a>.</p>

</div>
</div>
<a class="anchor" id="ac2d7bc13d9f1da8d6e67b88a1c37ed24"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XPciePsu_ComposeExternalConfigAddress </td>
          <td>(</td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Bus</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>Offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function Composes configuration space location. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Bus</td><td></td></tr>
    <tr><td class="paramname">Device</td><td></td></tr>
    <tr><td class="paramname">Function</td><td></td></tr>
    <tr><td class="paramname">Offset</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>location address of the composed address </dd></dl>

<p>References <a class="el" href="xpciepsu__hw_8h.html#a20a45b167585637a9c235ff5b012ca09">XPCIEPSU_ECAM_BUS_MASK</a>, <a class="el" href="xpciepsu__hw_8h.html#a43e34c012ad52ea9f676bc0be12b7755">XPCIEPSU_ECAM_BUS_SHIFT</a>, <a class="el" href="xpciepsu__hw_8h.html#a025cd22e68482e510c64559acafb2b7a">XPCIEPSU_ECAM_DEV_MASK</a>, <a class="el" href="xpciepsu__hw_8h.html#a656b4b5d6c324bb37973ad122d06e764">XPCIEPSU_ECAM_DEV_SHIFT</a>, <a class="el" href="xpciepsu__hw_8h.html#ad49fa35e338b4835db5b768e05377a94">XPCIEPSU_ECAM_FUN_MASK</a>, <a class="el" href="xpciepsu__hw_8h.html#a70e8568f9b38b009d293beb175ad7dad">XPCIEPSU_ECAM_FUN_SHIFT</a>, <a class="el" href="xpciepsu__hw_8h.html#a1f631e0208927a2a67ceade471bba3bc">XPCIEPSU_ECAM_MASK</a>, <a class="el" href="xpciepsu__hw_8h.html#ad790db72820f81029d65b4d420e05742">XPCIEPSU_ECAM_REG_MASK</a>, and <a class="el" href="xpciepsu__hw_8h.html#a37c37016f94f30ed1a242bed0ce2ba2f">XPCIEPSU_ECAM_REG_SHIFT</a>.</p>

<p>Referenced by <a class="el" href="xpciepsu_8h.html#a2c102ea980dacfdcfdfde291b60986be">XPciePsu_ReadConfigSpace()</a>, and <a class="el" href="xpciepsu_8h.html#a55212721869b9ddb1f187cdbefebdc57">XPciePsu_WriteConfigSpace()</a>.</p>

</div>
</div>
<a class="anchor" id="a862b72cd0796d429f122b5b83603f1d3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 XPciePsu_EnumerateBus </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function starts PCIe enumeration. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>pointer to XPciePsu Instance Pointer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if success 0 if fails </dd></dl>

<p>Referenced by <a class="el" href="xpciepsu__rc__enumerate__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a1cf81ffb26c43a972d2b92278b20cf7c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 XPciePsu_HasCapability </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Bus</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>CapId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns whether capability Id is available or not for the particular Function. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>pointer to XPciePsu Instance Pointer </td></tr>
    <tr><td class="paramname">Bus</td><td>is the number of the Bus </td></tr>
    <tr><td class="paramname">Device</td><td>is the number of the Device </td></tr>
    <tr><td class="paramname">Function</td><td>is number of the Function </td></tr>
    <tr><td class="paramname">cap</td><td>id to check capability pointer availability</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>u32 0 if capability is not available 1 if capability is available </dd></dl>

<p>References <a class="el" href="xpciepsu_8c.html#a2c102ea980dacfdcfdfde291b60986be">XPciePsu_ReadConfigSpace()</a>.</p>

</div>
</div>
<a class="anchor" id="acd35420aa1975d4b277d533e71be6187"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">XPciePsu_Config* XPciePsu_LookupConfig </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>DeviceId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function looks for the configuration of PCIe from the configTable based on the unique device ID. </p>
<p>The table XPciePsu_ConfigTable[] contains the configuration information for each device in the system.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DeviceId</td><td>is the unique device ID of the device being looked up.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the configuration table entry corresponding to the given device ID, or NULL if no match is found. </dd></dl>

<p>Referenced by <a class="el" href="xpciepsu__rc__enumerate__example_8c.html#aaa5f6815da393a21fa6e8d151c3569d0">PcieInitRootComplex()</a>, and <a class="el" href="xpciepsu__egress__ep__enable__example_8c.html#a71de060d9b164f1bcc1a31f0dea4fe07">XPciePsu_InitEndPoint()</a>.</p>

</div>
</div>
<a class="anchor" id="a95b11e3f3a7fc1ae339795b380fde121"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 XPciePsu_PrintAllCapabilites </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Bus</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Function</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function prints all the available capabilities in the Function. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>pointer to XPciePsu Instance Pointer </td></tr>
    <tr><td class="paramname">Bus</td><td>is the number of the Bus </td></tr>
    <tr><td class="paramname">Device</td><td>is the number of the Device </td></tr>
    <tr><td class="paramname">Function</td><td>is number of the Function</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS on success XST_FAILURE on failure. </dd></dl>

<p>References <a class="el" href="xpciepsu_8c.html#a2c102ea980dacfdcfdfde291b60986be">XPciePsu_ReadConfigSpace()</a>.</p>

</div>
</div>
<a class="anchor" id="a2c102ea980dacfdcfdfde291b60986be"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 XPciePsu_ReadConfigSpace </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Bus</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>Offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>DataPtr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function read from remote configuration space location. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>pointer to XPciePsu Instance Pointer </td></tr>
    <tr><td class="paramname">Bus</td><td></td></tr>
    <tr><td class="paramname">Device</td><td></td></tr>
    <tr><td class="paramname">Function</td><td></td></tr>
    <tr><td class="paramname">Offset</td><td>location of the address to read data from. </td></tr>
    <tr><td class="paramname">DataPtr</td><td>pointer store date available in the offset</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS on success XST_FAILURE on failure. </dd></dl>

<p>References <a class="el" href="xpciepsu_8c.html#ac2d7bc13d9f1da8d6e67b88a1c37ed24">XPciePsu_ComposeExternalConfigAddress()</a>, and <a class="el" href="xpciepsu_8c.html#a0cfd7833187346f6f654d80a359951b0">XPciePsu_ReadReg()</a>.</p>

<p>Referenced by <a class="el" href="xpciepsu__caps_8c.html#a1cf81ffb26c43a972d2b92278b20cf7c">XPciePsu_HasCapability()</a>, and <a class="el" href="xpciepsu__caps_8c.html#a95b11e3f3a7fc1ae339795b380fde121">XPciePsu_PrintAllCapabilites()</a>.</p>

</div>
</div>
<a class="anchor" id="ad974ca02c5108cc4d4afbfa809474c75"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 XPciePsu_ReadLocalConfigSpace </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>Offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>DataPtr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read 32-bit value from one of this IP own configuration space. </p>
<p>Location is identified by its offset from the beginning of the configuration space.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is the XPciePsu instance to operate on. </td></tr>
    <tr><td class="paramname">Offset</td><td>from beginning of IP own configuration space. </td></tr>
    <tr><td class="paramname">DataPtr</td><td>is a pointer to a variable where the driver will pass back the value read from the specified location.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS on success XST_FAILURE on failure.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p>References <a class="el" href="xpciepsu_8c.html#a0cfd7833187346f6f654d80a359951b0">XPciePsu_ReadReg()</a>.</p>

<p>Referenced by <a class="el" href="xpciepsu__rc__enumerate__example_8c.html#aaa5f6815da393a21fa6e8d151c3569d0">PcieInitRootComplex()</a>.</p>

</div>
</div>
<a class="anchor" id="a0cfd7833187346f6f654d80a359951b0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XPciePsu_ReadReg </td>
          <td>(</td>
          <td class="paramtype">UINTPTR&#160;</td>
          <td class="paramname"><em>BaseAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>RegOffset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function reads a register value from specified offset. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BaseAddr</td><td>BaseAddr of the register </td></tr>
    <tr><td class="paramname">RegOffset</td><td>Offset from the base address to be read</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Register value </dd></dl>

<p>Referenced by <a class="el" href="xpciepsu__egress__ep__enable__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>, <a class="el" href="xpciepsu__ep_8h.html#a6486e8d86d93762e998010aa29efd100">XPciePsu_Egress_EP_BridgeInitialize()</a>, <a class="el" href="xpciepsu__ep_8h.html#a99474c575ca291a93548797b66df45b8">XPciePsu_EP_BridgeInitialize()</a>, <a class="el" href="xpciepsu__egress__ep__enable__example_8c.html#a77aeb276879c8d92a9169d7f6c3f4b98">XPciePsu_EP_IntrHandler()</a>, <a class="el" href="xpciepsu__ep_8h.html#ad0ab59afa2bae270a5be2f4496945dde">XPciePsu_EP_SetupEgress()</a>, <a class="el" href="xpciepsu__ep_8h.html#a60670dca0dbddb37079e9917e41eae40">XPciePsu_EP_SetupIngress()</a>, <a class="el" href="xpciepsu__ep_8h.html#a1d40296b15e59da3006fda5faa6a5d9c">XPciePsu_EP_WaitForEnumeration()</a>, <a class="el" href="xpciepsu__ep_8h.html#aca1b71a1574b91939ee539c11556ce88">XPciePsu_EP_WaitForLinkup()</a>, <a class="el" href="xpciepsu_8h.html#a2c102ea980dacfdcfdfde291b60986be">XPciePsu_ReadConfigSpace()</a>, <a class="el" href="xpciepsu_8h.html#ad974ca02c5108cc4d4afbfa809474c75">XPciePsu_ReadLocalConfigSpace()</a>, and <a class="el" href="xpciepsu_8h.html#a55212721869b9ddb1f187cdbefebdc57">XPciePsu_WriteConfigSpace()</a>.</p>

</div>
</div>
<a class="anchor" id="a55212721869b9ddb1f187cdbefebdc57"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 XPciePsu_WriteConfigSpace </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Bus</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>Offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function write to remote configuration space location. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>pointer to XPciePsu Instance Pointer </td></tr>
    <tr><td class="paramname">Bus</td><td></td></tr>
    <tr><td class="paramname">Device</td><td></td></tr>
    <tr><td class="paramname">Function</td><td></td></tr>
    <tr><td class="paramname">Offset</td><td>location of the address to write data. </td></tr>
    <tr><td class="paramname">Data</td><td>to be written on to the offset</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS on success XST_FAILURE on failure. </dd></dl>

<p>References <a class="el" href="xpciepsu_8c.html#ac2d7bc13d9f1da8d6e67b88a1c37ed24">XPciePsu_ComposeExternalConfigAddress()</a>, <a class="el" href="xpciepsu_8c.html#a0cfd7833187346f6f654d80a359951b0">XPciePsu_ReadReg()</a>, and <a class="el" href="xpciepsu_8c.html#a558622766b2c01af123a216c1d682376">XPciePsu_WriteReg()</a>.</p>

</div>
</div>
<a class="anchor" id="a70154f924a73a1ee89b6b829bab05857"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 XPciePsu_WriteLocalConfigSpace </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>Offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write 32-bit value to one of this IP own configuration space. </p>
<p>Location is identified by its offset from the beginning of the configuration space.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is the PCIe component to operate on. </td></tr>
    <tr><td class="paramname">Offset</td><td>from beggininng of IP own configuration space. </td></tr>
    <tr><td class="paramname">Data</td><td>to be written to the specified location.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS on success XST_FAILURE on failure.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function is valid only when IP is configured as a root complex. </dd></dl>

<p>References <a class="el" href="xpciepsu_8c.html#a558622766b2c01af123a216c1d682376">XPciePsu_WriteReg()</a>.</p>

<p>Referenced by <a class="el" href="xpciepsu__rc__enumerate__example_8c.html#aaa5f6815da393a21fa6e8d151c3569d0">PcieInitRootComplex()</a>.</p>

</div>
</div>
<a class="anchor" id="a558622766b2c01af123a216c1d682376"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XPciePsu_WriteReg </td>
          <td>(</td>
          <td class="paramtype">UINTPTR&#160;</td>
          <td class="paramname"><em>BaseAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>RegOffset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function writes a register value to specified offset. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BaseAddr</td><td>Base Address of the register </td></tr>
    <tr><td class="paramname">RegOffset</td><td>Offset from the base address to be written </td></tr>
    <tr><td class="paramname">Val</td><td>Value to be written</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>none </dd></dl>

<p>Referenced by <a class="el" href="xpciepsu__egress__ep__enable__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>, <a class="el" href="xpciepsu__ep_8h.html#a6486e8d86d93762e998010aa29efd100">XPciePsu_Egress_EP_BridgeInitialize()</a>, <a class="el" href="xpciepsu__ep_8h.html#a99474c575ca291a93548797b66df45b8">XPciePsu_EP_BridgeInitialize()</a>, <a class="el" href="xpciepsu__egress__ep__enable__example_8c.html#a77aeb276879c8d92a9169d7f6c3f4b98">XPciePsu_EP_IntrHandler()</a>, <a class="el" href="xpciepsu__ep_8h.html#ad0ab59afa2bae270a5be2f4496945dde">XPciePsu_EP_SetupEgress()</a>, <a class="el" href="xpciepsu__ep_8h.html#a60670dca0dbddb37079e9917e41eae40">XPciePsu_EP_SetupIngress()</a>, <a class="el" href="xpciepsu_8h.html#a55212721869b9ddb1f187cdbefebdc57">XPciePsu_WriteConfigSpace()</a>, and <a class="el" href="xpciepsu_8h.html#a70154f924a73a1ee89b6b829bab05857">XPciePsu_WriteLocalConfigSpace()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
